<template>
  <div>
    <h1>关于我们</h1>
    <Button type="primary" @click="addCounter">全局数量加1</Button>
    <Input disabled :value="indexStore.counter"/>
    <Button type="primary" @click="tohome">去首页</Button>
    <Radio >Radio</Radio>
    <span>关于我们</span>
  </div>
</template>
<script lang="ts">
import { Button,Input,Radio } from 'ant-design-vue';
import { defineComponent } from "vue";
import { IndexStore } from "@/stores/main";
import router from "@/route";
export default defineComponent({
  components:{Button,Input,Radio},
  setup() {
    const indexStore = IndexStore();
    const addCounter = () => {
      indexStore.$patch({ counter: indexStore.counter + 1 })
    };
    const tohome = async () => {
      router.replace({
        path: '/home',
      });
    };
    return {
      indexStore,
      addCounter,
      tohome
    };
  },
});
</script> 
<style scoped>
</style>
